Introduction to Data Science with R

More on Quarto

Ina Bornkessel-Schlesewsky

January 25, 2024

Plan for today

  • A few notes on customising Quarto documents
  • Including references

Customising Quarto documents

  • We will work through this using the document customising_quarto.qmd, which is part of the zip-archive of files uploaded for this week

Including references

  • Quarto allows you to include references and compile a bibliography (in different formats)
  • You might want to make use of this for your project (or if you’re using Quarto to put together a report for other purposes) to avoid having to add references manually - but this is optional (it is an extra step to learn but it does save time and errors in the long run)
  • Note: if you’re not already using a reference manager for all of your referencing, whether in Quarto, Word or another word processing software, I would encourage you to get started with one as soon as possible!
    • My recommendation: Zotero, which is free and easy to use

Three (or four) easy steps

  1. Create a bib file (can be exported from a reference manager)1
  2. Save to your project directory and tell your Quarto file what it’s called
  3. (optional) Add a csl style file to customise your citation style
  4. Add references and render!


Creating a bib file in Zotero (example)

1. Create a collection in Zotero

]

Creating a bib file in Zotero (example)

2. Right-click to export

3. Choose Better BibTex and any other options and save

Creating a bib file in Zotero (example)

4. Save .bib file in your project directory

  • note that other reference managers (e.g. Endnote) will also allow you to export .bib files

In Quarto

  • add the name of your bib file to your header using the bibbliography option
  • optionally add a csl stylesheet to determine which style of referencing you want to use (you will need to download the csl file and again place it in your project directory – see the Rmd example on where to download)
  • start adding references – again, see the Rmd example on how to do this